#include <stdio.h>

#include "GLShow.h"
#include <iostream>

using namespace std;

using namespace IMG_Depth;
GLShow* gls;

int human_z = 500;
int human_y = 0;
int human_x = 0;

void drawBitmapText(char *string,float x,float y,float z) 
{  
	char *c;
	glColor3f(1.0,0.0,0.0);
	glRasterPos3f(x, y,z);

	for (c=string; *c != '\0'; c++) 
	{
		glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_10, *c);
	}
}




void display() 
{
	
	glPushMatrix();

	gls->Draw();	
	//drawBitmapText("Hello world!", human_x,human_y,  human_z + 0.2);

	glPopMatrix();
	
}
 
void keyboardProcess(unsigned char key, int x, int y)
{
	if(key == 'w')
	{
		human_z += 10;;
		cout << human_z << endl;
	}
	if(key == 's')
	{
		human_z -= 10;
		cout << human_z << endl;
	}
	if(key == 'd')
	{
		human_y += 10;;
	}
	if(key == 'a')
	{
		human_y -= 10;
	}
	if(key == 'q')
	{
		human_x += 10;;
	}
	if(key == 'e')
	{
		human_x -= 10;
	}
	display();
}

int main(int argc, char** argv)
{
	gls = new GLShow(&argc, argv);
	
	gls->Load("d:\\tmp\\mask5.ply");
	
	gls->setDisplayFunc(display);
	//gls->setKeyboardFunc(keyboardProcess);
	gls->run();
	return 0;
}

